package com.linsen.core.redis.util;

import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.*;

/**
 * @author zhaoyong
 * @date 2023/3/16
 */
@RequiredArgsConstructor
public final class RedisUtil<V> {
    private final RedisTemplate<String, V> redisTemplate;

    public RedisTemplate<String, V> getRedisTemplate() {
        return this.redisTemplate;
    }

    public ValueOperations<String, V> getOpsForValue() {
        return this.redisTemplate.opsForValue();
    }

    public HashOperations<String, String, V> getOpsForHash() {
        return this.redisTemplate.opsForHash();
    }

    public ListOperations<String, V> getOpsForList() {
        return this.redisTemplate.opsForList();
    }

    public SetOperations<String, V> getOpsForSet() {
        return this.redisTemplate.opsForSet();
    }

    public ZSetOperations<String, V> getOpsForZSet() {
        return this.redisTemplate.opsForZSet();
    }
}